home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group02b.txt / 000017_icon-group-sender_Mon Aug 19 13:09:36 2002.msg < prev    next >
Internet Message Format  |  2003-01-02  |  6KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id g7JK9Xs14419
  4.     for icon-group-addresses; Mon, 19 Aug 2002 13:09:33 -0700 (MST)
  5. Message-Id: <200208192009.g7JK9Xs14419@baskerville.CS.Arizona.EDU>
  6. From: jenjhiz@yahoo.com (Gene Kahn)
  7. X-Newsgroups: comp.lang.icon
  8. Subject: Re: What about "Expressions?" (was Re: Icon Wish List)
  9. Date: 18 Aug 2002 10:03:32 -0700
  10. X-Complaints-To: groups-abuse@google.com
  11. To: icon-group@cs.arizona.edu
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. Reply to Steve, Jesse, Christopher, and Hrvoje:
  16.  
  17. The sentences
  18.  
  19. The mouse the cat the dog the man kicked chased bit died.
  20. The horse raced past the barn collapsed.
  21.  
  22. are standard sentences in  introductory linguistics course that
  23. illustrate one point or another. Steve and Jesse's interpretation is
  24. the "generally accepted" reading:
  25.  
  26. The horse raced past the barn collapsed.
  27. = The horse (which was) raced past the barn collapsed.
  28.  
  29. Jesse's grandfather's reading (see below), as he pointed out, is
  30. incorrect or very marginal to most speakers. Most speakers don't
  31. delete "which" in that context.
  32.  
  33. The horse raced past the barn collapsed 
  34. ?= The horse (which) raced past the barn collapsed.
  35.  
  36. Setting off the the embedded clause with commas makes the sentence
  37. easy to read, but this sentence differs from the original in
  38. restrictiveness.
  39.  
  40. The horse, raced past the barn, collapsed. 
  41. <> The horse raced past the barn collapsed.
  42.  
  43. How did we get into a discussion of English grammar? Well, for one
  44. thing, one's ability to write grammatical English is a requisite to
  45. writing computer programs (in a revolutionary approach to
  46. programming), as someone suggested earlier. So I was testing if those
  47. I'm holding a discussion with are good programmers or not ;-). Also,
  48. these sentences illustrate that certain structures even in natural
  49. languages are harder to read than others. Headleass clause is one (the
  50. sentence about the horse), embedding is another (the sentence about
  51. the mouse), though, as Jesse pointed out, right-branching is easier to
  52. read:
  53.  
  54. ML-like
  55. The man kicked the dog
  56. which chased the cat
  57. which bit the mouse
  58. which died.
  59.  
  60. and that's because essentially this has the effect of compounding
  61. (concatenation).
  62.  
  63. It is not the plethora of parentheses that makes Lisp less readable to
  64. me. It is the fact that it allows left- AND center- AND
  65. right-branching (though indentation helps somewhat to clarify visually
  66. the branches) PLUS deep nesting.
  67.  
  68. Left-branching
  69. (+ (- (...)))
  70.  
  71. Center-branching
  72. (+ (* a (...) b) c) 
  73.  
  74. Right-branching
  75. (+ a (* b (...))) 
  76.  
  77. In concatenative languages (ML, Joy, etc.) , this would look like the
  78. following, which, at this level would has a simple sequential
  79. structure.
  80.  
  81. e1 . e2 . (...) . e3 . e4 
  82.  
  83. Nesting is unavoidable in a language that eschews variables and
  84. assignments, and to the programmer/writer the lure of deep nesting is
  85. hard to resist. This poses readability problems to the next programmer
  86. who has to maintain the code. (In my case, the comfort level is
  87. roughly two nestings and three variables, which make for 5 items,
  88. which is the lower bound of the magic number 7 plus or minus 2).
  89. Though, as has been pointed out, one can choose to go against the
  90. functional spirit of Lisp and use "let".
  91.  
  92. Now, you wouldn't want to say to someone "The mouse the cat the dog
  93. the man kicked chased bit died" even if you know that it is
  94. grammatical. So why would a programmer write in Lisp something like (+
  95. (* a (...) b ) c )? Well, because the language was designed to
  96. communicate with the compiler, and there is a heavy penalty if you
  97. don't treat this feature as rule number one. So why don't programming
  98. language designers think of designing an "artificial human" language
  99. for describing objects and their behavior primarily for human
  100. communication (but optimized under the hood for the compiler).
  101.  
  102. All this is getting to be out of topic. So back to the topic of the
  103. original thread: wish list. Wish list to make Icon more useful. For
  104. what tasks? For mainstream programming? Does Icon aspire to become a
  105. mainstream language?
  106.  
  107. Genghis Khan's Conclusion:
  108. If a language has not reached the mainstream within 9 years of Release
  109. 1.0, it never will.
  110.  
  111. I think that there is now nothing that proponents of Icon, Lisp,
  112. Scheme, Eiffel, Smalltalk, and a host of other languages can do to
  113. make their languages more mainstream (that is to say, as popularly
  114. used as C++, Java, and Visual Basic). They will remain 'niche'
  115. languages. This does not mean one should stop working on the language.
  116. I'd say make Icon the best language at what it does best
  117. (goal-directed processing), and make it a callable engine from
  118. mainstream languages, and make it ridiculously easy to use libraries
  119. and packages from other languages.
  120.  
  121. I'm off to the Scheme camp to check out what they have to offer ...
  122.  
  123. --gk
  124.  
  125.  
  126. Jesse Tov <tov@fas.harvard.REMOVE.edu> wrote in message news:<slrnalruu2.uij.tov@tov.student.harvard.edu>...
  127. > Christopher Browne <cbbrowne@acm.org>:
  128. > > (LET* ((A 1)
  129. > >        (B (* A 2)))
  130. > >    (+ A B))
  131. > > 
  132. > > which expands to
  133. > > (let ((a 1))
  134. > >    (let ((b (* a 2)))
  135. > >       (+ a b)))
  136. > So the same as scheme.
  137. > >>    The horse which raced past the barn collapsed.
  138. > >> When I hear it like this, it's ungrammatical to me.
  139. > > 
  140. > > The problem here isn't grammar; it's semantics, and semantics that
  141. > > don't make sense.
  142. > I disagree---the semantics are fine if "collapsed" is a verb:
  143. >    The horse collapsed.  Which horse collapsed?  The horse raced past
  144. >    the barn collapsed.
  145. > It's syntactically ambiguous, and with your parsing, the problem is
  146. > semantics, but with my parsing the semantics are fine.
  147. > > If we changed the last word from "collapsed" to "upright", it would
  148. > > read:
  149. > >    The horse raced past the barn upright. 
  150. > "Upright" just removes the ambiguity because it has to parse as an
  151. > adjective, and and the syntax tree in which it works (your parsing
  152. > above, but not mine) makes sense semantically.
  153. > Jesse
  154.